/*
package com.fanghuaiming.fescar.account.config;

import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

*/
/**
 * @author fanghuaiming
 * @Description: 定义fecar_account数据源使用Hikari
 *
 * @param:
 * @return:
 * @auther: fanghuaiming
 * @date: 2020/11/27 上午11:49
 * @version:1.0.0
 *//*

@Configuration
@MapperScan(basePackages = FescarAccountDataSourceConfig.PACKAGE, sqlSessionFactoryRef = "fecarAccountSqlSessionFactory")
public class FescarAccountDataSourceConfig {

    static final String PACKAGE = "com.fanghuaiming.fescar.account.dao.mapper";

    */
/**
     * @Description: 定义数据源
     *
     * @param:
     * @return:
     * @auther: fanghuaiming
     * @date: 2020/11/27 上午11:53
     * @version:1.0.0
     *//*

    @Bean(name = "fecarAccountDataSource")
    @Primary
    @ConfigurationProperties(prefix = "spring.datasource.fescar.account")
    public HikariDataSource fecarAccountDataSource() {
        return new HikariDataSource();
    }

    */
/**
     * @Description: 定义TM
     *
     * @param:
     * @return:
     * @auther: fanghuaiming
     * @date: 2020/11/27 上午11:53
     * @version:1.0.0
     *//*

    @Bean(name = "fecarAccountTransactionManager")
    @Primary
    public DataSourceTransactionManager fecarAccountTransactionManager() {
        return new DataSourceTransactionManager(this.fecarAccountDataSource());
    }

    */
/**
     * @Description: 定义factory
     *
     * @param:
     * @return:
     * @auther: fanghuaiming
     * @date: 2020/11/27 上午11:53
     * @version:1.0.0
     *//*

    @Bean(name = "fecarAccountSqlSessionFactory")
    @Primary
    public SqlSessionFactory fecarAccountSqlSessionFactory(@Qualifier("fecarAccountDataSource") DataSource dataSource) throws Exception {
        final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
        sessionFactory.setDataSource(dataSource);
        sessionFactory.setMapperLocations(
                new PathMatchingResourcePatternResolver().getResources("classpath:mappers/*.xml"));
        sessionFactory.getObject().getConfiguration().setMapUnderscoreToCamelCase(true);
        return sessionFactory.getObject();
    }
}
*/
